<?php
//
//  VictoryCMS - Content managment system and framework.
//  Copyright (C) 2009  Lewis Gunsch
//
//  This file is part of VictoryCMS.
//  
//  VictoryCMS is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  VictoryCMS is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//  
//  You should have received a copy of the GNU General Public License
//  along with VictoryCMS.  If not, see <http://www.gnu.org/licenses/>.

/**
 * VictoryCMS - DocumentManager
 * 
 * @license http://www.gnu.org/licenses/gpl.html
 * @author Lewis Gunsch
 * @filesource
 * @package DisplayablePages
 */

/**
 * Used for testing the DocumentManager
 * 
 * @package DisplayablePages
 *
 * @todo Needs design, implementation & documentation
 */
class Documents implements DisplayablePage {

	/** Document Manager component */
	private $docManager;
	
	/** Constructor */
	public function __construct() {
		
		//$this->docManager = ComponentFactory::createComponent("DocumentManager", "1");
	}
	
	/** Destructor */
	public function __destruct() {
		
		unset($this->docManager);
	}
	
	/*
	 * Returns the title of the Documents page
	 * in a string.
	 *
	 * @return The title of the documents page
	 **/
	public function getTitle() {
		return "Documents";
	}

	/**
	 * Returns the name of the Documents page
	 * in a string.
	 *
	 * @return The name of the page.
	 **/
	public function getName() {
		return "Documents Manager";
	}

	/**
	 * Returns a short text description of a
	 * DisplayablePage in a string.
	 *
	 * @return A short description of the page
	 **/
	public function getDescription() {
		return "The documents manager to upload and download files.";
	}

	/**
	 * Returns a comma seperated list of describing keywords
	 * in a string.
	 *
	 * @return A comma seperated keyword string
	 **/
	public function getKeywords() {
		return "";
	}


	/**
	 * Returns returns the css style sheet, javascript, etc
	 * in a string to be put into the header.
	 *
	 * @return The css stylesheet for the page in a string
	 */
	public function getHeaderInfo() {
		
		//TODO: finish me.
		return "";
	}

	/**
	 * Returns the html content of the page in a string.
	 * The content should not contain the template, just the page container
	 * content. The current page parameter will be set to the relative page
	 * path calling this function.
	 *
	 * @param currentPage The current relative page path calling this function.
	 *
	 * @return A string containing the html page content
	 **/
	public function renderPage( $currentPage ) {
		
		//TODO: finish me.
		$html = "";
		//$this->docManager->setCurrentPage($currentPage);
		//$html .= $this->docManager->renderComponent();
		
		return $html;
	}

	/**
	 * This method is run before the page is displayed and
	 * before any content is retrieved. This method is meant
	 * to let the page do any necessary preprocessing.
	 *
	 **/
	public function pagePreProcess() {
		
		// TODO: finish me.
		//$this->docManager->componentPreProcess();
	}
	 
	/**
	 * Returns the minimum necessary permissions
	 * needed to be able to view this page.
	 *
	 * @return Permission a permission object with permission set.
	 **/
	public function getPagePermissionLevel() {
		
		return new Permission("anonymous");
	}
}
?>